import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
//@ts-ignore 忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import App from "@/App.vue";
//@ts-ignore
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
//矢量图标svg集成
import "virtual:svg-icons-register";
//自动引入全局组件插件
import gloablComponent from "./components/index.ts";
//引入全局样式
import "@/styles/index.scss";
//引入路由
import router from "@/router/index.ts";
//引入仓库
import pinia from "@/store/index.ts";
//引入路由鉴权
import "./permission.ts";
//引入暗黑模式样式
import "element-plus/theme-chalk/dark/css-vars.css";

const app = createApp(App);

app.use(gloablComponent);
app.use(router);
app.use(pinia);
app.use(ElementPlus, {
  locale: zhCn,
});
//引入按钮权限控制自定义指令
import { isShowBtn } from "@/directive/btnPermission";
isShowBtn(app);
app.mount("#app");

//测试mock是否生效
// import axios from 'axios';
// axios({
//     url:'/api/user/login',
//     method:'post',
//     data:{
//         username:'admin',
//         password:'111111'
//     }
// })
